#include <iostream>
#include <string>
// 包含SpireMS SDK头文件
#include <sms_core.h>
#include "sv2_autofocus_det.h"


using namespace std;


const char* about = "AutoFocus Detection Demo";
const char* keys  =
    "{@job_name      |<none> | The node's job name }"
    "{@full_det_name |<none> | Full image detector's job_name }"
    "{@roi_det_name  |<none> | ROI detector's job_name }"
    "{@param_file    |<none> | AutoFocusDetCppNode's parameters }";


int main(int argc, char *argv[])
{
    cv::CommandLineParser parser(argc, argv, keys);
    parser.about(about);

    if(argc < 5) {
        parser.printMessage();
        return 0;
    }

    std::cout << "job_name: " << parser.get<std::string>(0) << std::endl;
    std::cout << "full_det_name: " << parser.get<std::string>(1) << std::endl;
    std::cout << "roi_det_name: " << parser.get<std::string>(2) << std::endl;
    std::cout << "config: " << parser.get<std::string>(3) << std::endl;

    std::string job_name = parser.get<std::string>(0);
    std::string full_det_name = parser.get<std::string>(1);
    std::string roi_det_name = parser.get<std::string>(2);
    std::string config = parser.get<std::string>(3);

    sv2::AutoFocusDetCppNode node(job_name, full_det_name, roi_det_name, config);
    node.start();
    node.join();
    return 0;
}
